package com.hww.gannan.common;

import com.hww.gannan.entity.Message;

import java.util.ArrayList;
import java.util.List;

public class UserExport extends EasyExcelTemplate<Message, Object> {
    @Override
    public List processData(List t) {
        return null;
    }

    @Override
    public List<List<Object>> dataList(List<Message> list) {
        if (list == null || list.size() == 0) return null;
        List<List<Object>> dataList = new ArrayList<>();
        Integer count = 1;

        for (Message message : list) {
            List<Object> data = new ArrayList<>();
            data.add(count);
            data.add(message.getMessage());
            data.add(message.getName());
            dataList.add(data);
            count++;
        }
        return dataList;
    }
}
